﻿using System;
using TrafficArchives.Utilities;

namespace TrafficArchives
{
    public partial class Top : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblUser.InnerText = LoginUser.Current.UserName;
                LblRole.InnerText = LoginUser.Current.RoleName;
                lblDate.InnerText = DateTime.Now.ToString("yyyy年MM月dd日") + "　" + ChineseWeek();
            }

        }

        private string ChineseWeek()
        {
            switch (DateTime.Now.DayOfWeek)
            {
                 case DayOfWeek.Monday:
                    return "星期一";
                case DayOfWeek.Tuesday:
                    return "星期二";
                case DayOfWeek.Wednesday:
                    return "星期三";
                case DayOfWeek.Thursday:
                    return "星期四";
                case DayOfWeek.Friday:
                    return "星期五";
                case DayOfWeek.Saturday:
                    return "星期六";
            }
            return "星期天";
        }
    }
}